#ifndef _I_BUSINESS_H
#define _I_BUSINESS_H
#include "IServlet.h"
#include "IProto.h"
#define WITH_BUSINESS_COPY(NAME) \
    void copyTo(std::string &buffer){\
        buffer.resize(sizeof(NAME) + 8);new(&buffer[0])NAME;\
    }
class IBusiness : public IPlugin {
public:
    virtual int dispatchActions(ISession *session,void *data,int size) = 0;
     
    virtual const char *getBusinessName() {
        return "";
    }
    IBusiness() {
        next = NULL;
    }
    virtual ~IBusiness() {

    }
    virtual void copyTo(std::string &buffer) {}

    virtual void onOpen(ISession *session){}
    virtual void onClose(ISession *session){}
    virtual void onError(ISession *session,int code){}
    IBusiness *next;
}; 

#endif // _I_BUSINESS_H